Namespaced controllers and Object is not missing constants XXX exception #530
base: master
Are you sure you want to change the base?
Conversation
added the passing of the controller to the lambda |
@fuelxc Unfortunately the pull requests don't cleanly merge against master. Would you be able to rebase this and ping me to verify once you have a clean merge? |
* 'master' of https://github.com/ryanb/cancan: Clarify readme for rails 2.3 users adding a .rbenv-version file Add check for Enumerable as condition value adding project status message to readme Just add singleton to description of authorize_resource Don't remove key-value from the subject hash we might want to use it again. adding travis-ci badge Pass forward :if and :unless options to the before filter. i.e: Fixed bug with params for actions that build new instances with namespaced models Use latest with_model gem Conflicts: spec/cancan/controller_resource_spec.rb
I merged and pushed now. Cheers |
@ryanb The tests all pass. There are quite a few concepts going on, but they look good. |
@fuelxc: Thanks for the pull request and sorry for such a long delay in merging this request. Can you please give us a real-world use case where you encountered this issue originally. Quite a few namespace related pull requests have been merged recently and I just wanted to find out the actual issue this one is solving. Thanks. |
It was a fair bit ago, so I apologize that i can't remember exact details, but basically it was an STI and I was getting an exception "Object is not missing constants" on a namespaced controller. The only way I found to correct it was to use a lambda to determine what was needed on request. |
Out of curiosity has this been solved a separate way? |
Thanks for your submission! The ryanb/cancan repository has been inactive since Sep 06, 2013. CanCan has many open issues, including missing support for Rails 4. To keep CanCan alive, an active fork exists at cancancommunity/cancancan. The new gem is cancancan. More info is available at #994. If your pull request or issue is still applicable, it would be really appreciated if you resubmit it to CanCanCan. We hope to see you on the other side! |
This change seems more like a workaround than a fix but I am unable to correct any other way and my previous change for including :class => lambda{} doesn't seem to be working in all cases